////
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include<stdio.h>

using namespace std;

int main() {
    char station = 'B';
    int bit = 0;
    vector<int> A = { -1, -1, -1, 1, 1, -1, 1, 1 };
    vector<int> B = { -1, -1, 1, -1, 1, 1, 1, -1 };
    vector<int> C = { -1, 1, -1, 1, 1, 1, -1, -1 };
    vector<int> D = { -1, 1, -1, -1, -1, -1, 1, -1 };
    vector<int> input_seq;
    int code_sequence[8];
    printf("请输入码片序列（每行一个码片）：\n");
    for (int i = 0; i < 8; i++) {
        scanf_s("%d", &code_sequence[i]);
        input_seq.push_back(code_sequence[i]);
    }
    int dot_product_A = 0;
    int dot_product_B = 0;
    int dot_product_C = 0;
    int dot_product_D = 0;
    for (int i = 0; i < input_seq.size(); i++) {
        dot_product_A += input_seq[i] * A[i];
        dot_product_B += input_seq[i] * B[i];
        dot_product_C += input_seq[i] * C[i];
        dot_product_D += input_seq[i] * D[i];
    }

    if (dot_product_A == 0) {
        string station = "B";
        printf("发送数据的是站%c 发送的是%d\n", station, bit);
    }
    else if (dot_product_B == 0) {
        string station = "A";
        printf("发送数据的是站%c 发送的是%d\n", station, bit);
    }
    else if (dot_product_C == 0) {
        string station = "C";
        printf("发送数据的是站%c 发送的是%d\n", station, bit);
    }
    else {
        string station = "D";
        printf("发送数据的是站%c 发送的是%d\n", station, bit);
    }

    if (dot_product_A > 0) {
        int bit = 1;
        printf("发送数据的是站%c 发送的是%d\n", station, bit);
    }
    else {
        int bit = 0;
        printf("发送数据的是站%c 发送的是%d\n", station, bit);
    } 
    printf("生病了")

    return 0;
}